<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>6.270 - JoyOS: servo.h File Reference</title>
	<link href="main.css" media="screen" rel="Stylesheet" type="text/css"/>
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>  
<body>
	<div id="header">
		<div id="headerb">
		<div id="headtext">
			<span class="titletext">AUTONOMOUS ROBOT DESIGN COMPETITION</span>
			6.270
		</div>
		<div class="mainmenu">
			<a href="http://web.mit.edu/6.270/www">Home</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/about/">About</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/sponsors/">Sponsors</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contests/">Past Contests</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contestants/">Contestant Information</a>
		</div>
	</div>
	</div>

<div class="maincontent">
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>servo.h File Reference</h1>Servo outputs. <a href="#_details">More...</a>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="servo_8h.html#32befddd5759ec16ab7964d78e2252c5">servo_init</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="servo_8h.html#e0043abcd95e1f7c8640ca0be533a0d4">servo_set_pos</a> (uint8_t servo, uint16_t pos)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The happyboard as 6 servo outputs.<p>
Each servo has a 9bit register used to set it's position. Setting the servo to 0 will cause it to move to its counter-clockwise limit, while setting it to 511, will cause it to move to its clockwise limit. <hr><h2>Function Documentation</h2>
<a class="anchor" name="32befddd5759ec16ab7964d78e2252c5"></a><!-- doxytag: member="servo.h::servo_init" ref="32befddd5759ec16ab7964d78e2252c5" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void servo_init           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initialize servos. Should not be called by user. 
</div>
</div><p>
<a class="anchor" name="e0043abcd95e1f7c8640ca0be533a0d4"></a><!-- doxytag: member="servo.h::servo_set_pos" ref="e0043abcd95e1f7c8640ca0be533a0d4" args="(uint8_t servo, uint16_t pos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void servo_set_pos           </td>
          <td>(</td>
          <td class="paramtype">uint8_t&nbsp;</td>
          <td class="paramname"> <em>servo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>pos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a servo position.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>servo</em>&nbsp;</td><td>Servo to set. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>New servo value (0..511) </td></tr>
  </table>
</dl>

</div>
</div><p>
</div>
</div>
<div class="maincontent">
	<div class="footer centre">
		<hr>
		Generated on Sun Jan 18 22:59:34 2009 by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> 1.5.6<br/>
		6.270 Staff, 2008 | 
		<a href="mailto:6.270-organizers@mit.edu">Contact Us</a> | 
		<a href="http://web.mit.edu">MIT</a>
	</div>
</div>
</body>
</html>
